#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read<int>()
#define inn read<ll>()
#define pli pair<ll,int>
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

template <typename T>
T read(){
	T x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 1e5+10;
int n,rt,sz[N],h[N],cnt;
ll d[N],td[N];
struct edge{int v,nxt;}e[N<<1];
unordered_map<ll,int> mp;
set<pli> s;
vector<pii> G;
void link(int x,int y){e[++cnt] = (edge){y,h[x]};h[x] = cnt;}

void dfs(int x,int p){
	sz[x] = 1;
	for(int i = h[x],y;i;i = e[i].nxt){
		if((y = e[i].v) == p) continue; dfs(y,x);
		td[x] += td[y] + sz[y]; sz[x] += sz[y];
	}
}

void ddfs(int x,int p){
	if(td[x] != d[x]) exit(puts("-1")*0);
	for(int i = h[x],y;i;i = e[i].nxt){
		if((y = e[i].v) == p) continue; td[y] = td[x] - sz[y] + n - sz[y];
		ddfs(y,x);
	}
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; rt = 0; for(int i = 1;i <= n;i++){d[i] = inn;if(!rt || d[rt] > d[i]) rt = i;}
	for(int i = 1;i <= n;i++){
		mp[d[i]] = i;
		s.insert(pli(d[i],i));
	}
	for(int i = 1;i <= n;i++) sz[i] = 1;
	for(int i = 1;i < n;i++){
		pli t = *(--s.end()); s.erase(t);
		ll fdis = t.fi + 2 * sz[t.se] - n;
		int ft = mp[fdis]; if(ft == t.se) return puts("-1"),0; G.pb(pii(t.se,ft));
		sz[ft] += sz[t.se];
	}
	for(pii t : G) link(t.fi,t.se),link(t.se,t.fi);
	dfs(rt,0); ddfs(rt,0);
	for(pii t : G) printf("%d %d\n",t.fi,t.se);
	return 0;
}

